
<!DOCTYPE html>
<html>
<head>
  <title>${user.username!''}的主页</title>
   <#include "../common/link.ftl">
</head>
<body style="margin-top: 65px;">

<#include "../common/header.ftl">

<div class="fly-home fly-panel" style="background-image: url();">
    <img src="${ctx.contextPath}${user.avatar!''}" alt="${user.username!''}">
  <h1>
    ${user.username!''}
    <#if (user.gender!'') == "男">
        <i class="iconfont icon-nan"></i>
    <#else>
        <i class="iconfont icon-nv"></i>
    </#if>
  </h1>

  <#if user.role == "admin">
      <p style="padding: 10px 0; color: #5FB878;">认证信息：<i class="layui-badge fly-badge-vip layui-bg-green">管理员</i></p>
  </#if>

  <p class="fly-home-info">
    <i class="layui-icon layui-icon-dollar">&#xe659;</i><span style="color: #FF7200;">${user.treasure!''} 财富</span>
    <i class="iconfont icon-shijian"></i><span>${(user.createTime!'')?string("yyyy-MM-dd")} 加入</span>
    <i class="iconfont icon-chengshi"></i><span>来自 ${user.city!"火星"}</span>
  </p>

  <p class="fly-home-sign">（${user.sign!'这个家伙很懒，什么也没留下'}）</p>

  <div class="fly-sns" data-user="">
    <a href="javascript:;" class="layui-btn layui-btn-primary fly-imActive" data-type="addFriend">加为好友</a>
    <a href="javascript:;" class="layui-btn layui-btn-normal fly-imActive" data-type="chat">发起会话</a>
  </div>

</div>

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md6 fly-home-jie">
      <div class="fly-panel">
        <h3 class="fly-panel-title">${user.username!''} 最近的提问</h3>
        <ul class="jie-row">
          <#if posts??>
            <#list posts as post>
                <li>
                    <#if post.numReply gt 30>
                        <span class="fly-jing">精</span>
                    </#if>
                    <a href="${ctx.contextPath}/post/detail/${post._id}" class="jie-title">${post.title}</a>
                    <i>${post.createTime?string("yyyy-MM-dd")}</i>
                    <em class="layui-hide-xs">${post.numLook}阅/${post.numReply}答</em>
                </li>
            </#list>
          <#else>
            <div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;"><i style="font-size:14px;">没有发表任何求解</i></div>
          </#if>
        </ul>
      </div>
    </div>
    
    <div class="layui-col-md6 fly-home-da">
      <div class="fly-panel">
        <h3 class="fly-panel-title">${user.username!''} 最近的回答</h3>
        <ul class="home-jieda">
            <#if replys??>
                  <#list replys as reply>
                      <li>
                          <p>
                              <span>${reply.replyTime?string("yyyy-MM-dd HH:mm:ss")}</span>
                              在<a href="${ctx.contextPath}/post/detail/${reply.postId}" target="_blank">${reply.postTitle}</a>中回答：
                          </p>
                          <div class="home-dacontent">
                              ${reply.content}
                          </div>
                      </li>
                  </#list>
            <#else>
              <div class="fly-none" style="min-height: 50px; padding:30px 0; height:auto;"><span>没有回答任何问题</span></div>
            </#if>
        </ul>
      </div>
    </div>
  </div>
</div>

<#include "../common/footer.ftl">

<script>
layui.cache.page = 'user';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '${ctx.contextPath}/static/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({
  version: "3.0.0"
  ,base: '${ctx.contextPath}/static/mods/'
}).extend({
  fly: 'index'
}).use(['fly', 'face'],function(){
    var $ = layui.$,fly = layui.fly;
    $('.home-dacontent').each(function(){
        var othis = $(this), html = othis.html();
        othis.html(fly.content(html));
    });
});
</script>

</body>
</html>